package cn.qingyun.gis.modules.enterprise.aggregate.controller;

import cn.qingyun.gis.common.Result;
import cn.qingyun.gis.modules.enterprise.aggregate.request.AggregateRequest;
import cn.qingyun.gis.modules.enterprise.aggregate.request.BuildRequest;
import cn.qingyun.gis.modules.enterprise.aggregate.service.AggregateService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 *
 * @author wz
 * @version JDK 8
 * @className AggregateController
 * @date 2024/10/28
 * @description 企聚controller
 */
@RestController
@RequestMapping("/aggregate")
public class AggregateController {

    @Resource
    private AggregateService aggregateService;

    /**
     * 企聚列表
     * @param request
     * @return
     * @description 聚合建筑上有5户以上的POI，小于5户不展示
     */
    @PostMapping("/list")
    public Result<?> getAggregateList(@RequestBody AggregateRequest request){
        return Result.okData(aggregateService.getAggregateList(request));
    }

    /**
     * 企聚详情
     * @param request
     * @return
     */
    @PostMapping("/getDetail")
    public Result<?> getDetail(@RequestBody BuildRequest request){
        return Result.okData(aggregateService.getDetail(request));
    }


    /**
     * 企聚统计信息
     * @param request
     * @return
     */
    @PostMapping("/getStaticInfo")
    public Result<?> getStaticInfo(@RequestBody AggregateRequest request){
        return Result.okData(aggregateService.getStaticInfo(request));
    }

    /**
     * 导出企聚统计信息
     * @param request
     * @return
     */
    @GetMapping("/export/aggStatic")
    public Result<?> exportAggStatic(@RequestBody AggregateRequest request){
        return Result.okData(aggregateService.exportAggStatic(request));
    }

    //建筑详情统计信息
    @GetMapping("/export/buildStatic")
    public Result<?> exportBuildStatic(@RequestBody AggregateRequest request){
        return Result.okData(aggregateService.exportAggStatic(request));
    }
}
